/**
 * @author James Simpson
 * About: Blogger Show/Hide Expand controls for Widgets 
 */
function addShowHide(strWidget, colorScheme) {
  var $Widget = $("#" + strWidget),
      $Header = $Widget.children("h2").first();

  if(typeof($Header) != 'undefined')
  {
    var strContWidget = "cont" + strWidget;

    var $Cont = $Widget.children("div").first();
    if($Cont.attr("id") == ""){$Cont.attr("id", strContWidget);}
    else { strContWidget = $Cont.attr("id"); }

    //create and add a show/hide anchor
    var $ShowHide = $('<span class="show-hide-button sh-' + colorScheme + '-down"></span>');
	$ShowHide.attr("data-color-scheme", colorScheme);
	$ShowHide.attr("data-cont", strContWidget);
	$ShowHide.addClass("show-hide-button-" + colorScheme);
	$ShowHide.addClass("sh-down-" + colorScheme);
	
    $Header.prepend($ShowHide);
	$ShowHide.click(doSlide);
  }
}
function doSlide() {
	$(this).toggleClass("sh-down-" + $(this).attr("data-color-scheme") + " sh-up-" + $(this).attr("data-color-scheme"));
  	$("#" + $(this).attr("data-cont")).slideToggle('fast');
}